<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>点击复核，根据id查看复核信息</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/bootstraptable/bootstrap-table.min.css" rel="stylesheet">

</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-5 h5" style="margin-top: 20px; color: deepskyblue;padding-left: 0px;">您正在做的业务是：产品设计--产品档案管理--产品档案登记复核</div>
    </div>
    <div class="row">
        <div class="col-md-2 col-md-offset-10">
            <button type="button" class="btn btn-default btn-sm" style="background-color: lightblue;" id="file_upd_btn">复核通过</button>
            <button type="button" class="btn btn-default btn-sm" style="background-color: lightblue;"  onclick="history.back(-1);">返回</button>
        </div>
    </div>
    <div class="col-lg-12" style="border: 1px solid lightgrey">
        <div class="row" style="border: 1px solid gainsboro;background-color: #0e9aef;">
            <div class="col-md-12 h4" style="color: white">主信息</div>
        </div>
        <div class="row">
            <form class="form-horizontal col-md-12" style="margin-top: 3px" id="file_upd_form">
                <input type="hidden" name="id" id="id" />
                <div class="form-group">
                    <label class="col-md-1 control-label" style="padding-right: 0px;">产品编号</label>
                    <div class="col-md-5" style="padding-left: 5px">
                        <input type="text" style="border: none; background-color: white" readonly class="form-control" name="productId" id="productId">
                    </div>
                </div>
                <div class="form-group">
                    <label for="productName" class="col-md-1 control-label" style="padding-right: 0px;">
                        产品名称</label>
                    <div class="col-md-5" style="padding-left: 5px">
                        <input type="text" class="form-control" name="productName" id="productName">
                    </div>
                    <label for="factoryName" class="col-md-1 control-label" style="padding-right: 0px">制造商</label>
                    <div class="col-md-5" style="padding-left: 5px">
                        <input type="text" class="form-control" name="factoryName" id="factoryName" >
                    </div>
                </div>
                <div class="form-group">
                    <label for="firstKindName" class="col-md-1 control-label" style="padding-right: 0px;">
                        I级分类</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <select class="form-control" name="firstKindName" id="firstKindName">
                            <option value="-1">--请选择--</option>
                        </select>
                    </div>
                    <label for="secondKindName" class="col-md-2 control-label" style="padding-right: 0px;">
                        II级分类</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <select class="form-control" name="secondKindName" id="secondKindName">
                            <option value="-1">--请选择--</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="thirdKindName" class="col-md-1 control-label" style="padding-right: 0px;">
                        III级分类</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <select class="form-control" name="thirdKindName" id="thirdKindName">
                            <option value="-1">--请选择--</option>
                        </select>
                    </div>
                    <label for="productNick" class="col-md-2 control-label" style="padding-right: 0px">产品简称</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="productNick" id="productNick">
                    </div>
                </div>
                <div class="form-group">
                    <label for="type" class="col-md-1 control-label" style="padding-right: 0px">用途类型</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <select class="form-control" name="type" id="type">
                            <option value="-1">--请选择--</option>
                            <option value="Y001-1">商品</option>
                            <option value="Y001-2">物料</option>
                        </select>
                    </div>
                    <label for="productClass" class="col-md-2 control-label" style="padding-right: 0px">档次级别</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <select class="form-control" name="productClass" id="productClass">
                            <option value="-1">--请选择--</option>
                            <option value="D001-1">高档</option>
                            <option value="D001-2">中档</option>
                            <option value="D001-3">低档</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="personalUnit" class="col-md-1 control-label" style="padding-right: 0px">计量单位</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="personalUnit" id="personalUnit">
                    </div>
                    <label for="personalValue" class="col-md-2 control-label" style="padding-right: 0px">计量值</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="personalValue" id="personalValue" >
                    </div>
                </div>
                <div class="form-group">
                    <label for="listPrice" class="col-md-1 control-label" style="padding-right: 0px;">
                        市场单价(元)</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="listPrice" id="listPrice">
                    </div>
                    <label for="costPrice" class="col-md-2 control-label" style="padding-right: 0px;">
                        计划成本单价</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="costPrice" id="costPrice" >
                    </div>
                </div>
                <div class="row" style="border: 1px solid gainsboro;background-color: #0e9aef;">
                    <div class="col-md-12 h4" style="color: white">辅助信息</div>
                </div>
                <div class="form-group" style="margin-top: 3px;">
                    <label for="warranty" class="col-md-1 control-label" style="padding-right: 0px;">保修期</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="warranty" id="warranty">
                    </div>
                    <label for="twinName" class="col-md-2 control-label" style="padding-right: 0px;">替代品名称</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="twinName" id="twinName" >
                    </div>
                </div>
                <div class="form-group">
                    <label for="twinId" class="col-md-1 control-label" style="padding-right: 0px;">替代品编号</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="twinId" id="twinId" >
                    </div>
                    <label for="lifecycle" class="col-md-2 control-label" style="padding-right: 0px;">生命周期(年)</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="lifecycle" id="lifecycle">
                    </div>
                </div>
                <div class="form-group">
                    <label for="amountUnit" class="col-md-1 control-label" style="padding-right: 0px;">单位</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="amountUnit" id="amountUnit">
                    </div>
                </div>
                <div class="form-group">
                    <label for="providerGroup" class="col-md-1 control-label" style="padding-right: 0px;">供应商集合</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <textarea rows="3" cols="50" class="form-control" style="resize: none;overflow-y: scroll" name="providerGroup" id="providerGroup"></textarea>
                    </div>
                    <label for="productDescribe" class="col-md-2 control-label" style="padding-right: 0px;">产品描述</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <textarea rows="3" cols="50" class="form-control" style="resize: none;overflow-y: scroll" name="productDescribe" id="productDescribe"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="responsiblePerson" class="col-md-1 control-label" style="padding-right: 0px;">产品经理</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="responsiblePerson" id="responsiblePerson">
                    </div>
                    <label for="register" class="col-md-2 control-label" style="padding-right: 0px;">登记人</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="register" id="register">
                    </div>
                </div>
                <div class="form-group">
                    <label for="checker" class="col-md-1 control-label" style="padding-right: 0px;">复核人</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input type="text" class="form-control" name="checker" id="checker" >
                    </div>
                    <label for="checkTime" class="col-md-2 control-label" style="padding-right: 0px;">复核时间</label>
                    <div class="col-md-4" style="padding-left: 5px">
                        <input style="border: none; background-color: white" readonly class="form-control" type="text" name="checkTime" id="checkTime" />
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<script src="/js/currentTime.js"></script>

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>

<script>
    $(function (){
        //各级分类下拉框
        firstKind()
        secondKind()
        thirdKind()

        //获取档案信息id
        let id=localStorage.getItem("id")
        //根据id查看复核信息
        setTimeout(function (){
            $.post("/design/file/getId",{"id":id},function (res){
                page(res)
            })
        },100)

        //复核时间
        $("#checkTime").val(add(fortime()))

        //点击复核通过按钮
        $("#file_upd_btn").click(function (){
            let parms=$("#file_upd_form").serialize()
            $.post("/design/file/reviewPassed",parms,function (res) {
                if(res==true){
                    window.location="/design/design_file_reviewUI"
                }
            })
        })


    })
    //I级分类
    function firstKind(){
        $.post("/design/file/select",{"kid":"1"},function (res){
            $("#file_search_form #firstKindName option:gt(0)").remove()
            for(let i=0;i<res.length;i++){
                let obj=res[i]
                let $op=$("<option>"+obj.kindId+"/"+obj.kindName+"</option>")
                $op.val(obj.kindId+"/"+obj.kindName)
                $("#firstKindName").append($op)
            }
        })
    }
    //II级分类
    function secondKind(){
        $.post("/design/file/select",{"kid":"2"},function (res){
            $("#file_search_form #secondKindName option:gt(0)").remove()
            for(let i=0;i<res.length;i++){
                let obj=res[i]
                let $op=$("<option>"+obj.kindId+"/"+obj.kindName+"</option>")
                $op.val(obj.kindId+"/"+obj.kindName)
                $("#secondKindName").append($op)
            }
        })
    }
    //III级分类
    function thirdKind(){
        $.post("/design/file/select",{"kid":"3"},function (res){
            $("#file_search_form #thirdKindName option:gt(0)").remove()
            for(let i=0;i<res.length;i++){
                let obj=res[i]
                let $op=$("<option>"+obj.kindId+"/"+obj.kindName+"</option>")
                $op.val(obj.kindId+"/"+obj.kindName)
                $("#thirdKindName").append($op)

            }
        })
    }

    //加载页面的数据
    function page(res){
        $("#id").val(res.id)
        $("#productId").val(res.productId)
        $("#productName").val(res.productName)
        $("#factoryName").val(res.factoryName)
        $("#firstKindName").val(res.firstKindId+"/"+res.firstKindName)
        $("#secondKindName").val(res.secondKindId+"/"+res.secondKindName)
        $("#thirdKindName").val(res.thirdKindId+"/"+res.thirdKindName)
        $("#productNick").val(res.productNick)
        $("#type").val(res.type)
        $("#productClass").val(res.productClass)
        $("#personalUnit").val(res.personalUnit)
        $("#personalValue").val(res.personalValue)
        $("#listPrice").val(res.listPrice)
        $("#costPrice").val(res.costPrice)
        $("#warranty").val(res.warranty)
        $("#twinName").val(res.twinName)
        $("#twinId").val(res.twinId)
        $("#lifecycle").val(res.lifecycle)
        $("#amountUnit").val(res.amountUnit)
        $("#responsiblePerson").val(res.responsiblePerson)
        $("#providerGroup").val(res.providerGroup)
        $("#productDescribe").val(res.productDescribe)
        $("#register").val(res.register)
        $("#checker").val(res.checker)
    }

</script>
</body>
</html>